package com.blue.bluecode;

import android.app.Activity;
import android.os.Bundle;
import android.widget.RatingBar;
import android.widget.TextView;


public class RatingBarActivity extends Activity {

    private RatingBar rbRatingBar;
    private TextView tvRatingBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rating_bar);
        getActionBar().setDisplayHomeAsUpEnabled(true);

        rbRatingBar = (RatingBar) findViewById(R.id.rbRatingBar);
        tvRatingBar = (TextView) findViewById(R.id.tvRatingBar);

        rbRatingBar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
            @Override
            public void onRatingChanged(RatingBar ratingBar, float v, boolean b) {
                tvRatingBar.setText(v+" == "+b);
            }
        });

    }

}
